package com.chance.cc.crawler.prod.command.trigger.domain.vm.xcar.trace;

import com.chance.cc.crawler.core.CrawlerJob;
import com.chance.cc.crawler.core.downloader.HttpPage;
import com.chance.cc.crawler.meta.core.bean.CrawlerMetaConstant;
import com.chance.cc.crawler.prod.command.job.domain.vm.xcar.Geely.XcarForumTopicGeelyTraceCrawlerScheduleJob;
import com.chance.cc.crawler.prod.command.job.domain.vm.xcar.trace.XcarForumTopicTraceCrawlerScheduleJob;
import com.chance.cc.crawler.prod.command.trigger.CommonCrawlerSchedulerTrigger;

/**
 * @author bx
 * @date 2020/12/7 0007 11:15
 */
public class XcarForumReplyTraceScheduleTrigger extends CommonCrawlerSchedulerTrigger {

    public static void main(String[] args) {
//        CrawlerJob crawlerJob = XcarForumReplyTraceCrawlerScheduleJob.xcarCwalerJob();
//        publishXcarNewsScheduleTriggerInfo(crawlerJob.generateCrawlerKey(),crawlerJob.generateCrawlerTriggerKey());

        //吉利项目
        publishXcarForumTraceSchedulerTriggerInfo();
    }

    public static void publishXcarNewsScheduleTriggerInfo(String crawlerKey,String crawlerTriggerKey){
        HttpPage page = metaServiceCommand_17.addOrUpdateScheduleCrawlerTrigger(
                crawlerKey,
                crawlerTriggerKey,
                XcarForumTopicTraceCrawlerScheduleJob.domain,
                CrawlerMetaConstant.ScheduleJobTrigger_Cron,
                "0 10 3 * * ?",
                "爱卡汽车论坛回帖每天3：10采集一次");
        System.out.println("添加采集调度： "+page.getRawText());
    }


    /**
     * 吉利项目 爱卡论坛发布时间排序
     */
    public static void publishXcarForumTraceSchedulerTriggerInfo(){
        CrawlerJob crawlerJob = XcarForumTopicGeelyTraceCrawlerScheduleJob.xcarCwalerJob();

        HttpPage page = metaServiceCommand_17.addOrUpdateScheduleCrawlerTrigger(
                crawlerJob.generateCrawlerKey(),
                crawlerJob.generateCrawlerTriggerKey(),
                XcarForumTopicTraceCrawlerScheduleJob.domain,
//                CrawlerMetaConstant.ScheduleJobTrigger_Simple,
                CrawlerMetaConstant.ScheduleJobTrigger_Cron,
                "0 0 17 * * ?",
//                "",
                "爱卡汽车论坛吉利项目发布时间排序，每日3:10采集一次");
        System.out.println("添加采集调度： "+page.getRawText());
    }
}
